<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title><#if op??><#if op="view">查看<#elseif op="edit">修改</#if><#else>新增</#if>广告</title>
	<link href="/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div class="place">
    	<span>位置：</span>
	    <ul class="placeul"><li><a href="/index.html">首页</a></li><li><#if op??><#if op="view">查看<#elseif op="edit">修改</#if><#else>新增</#if>广告</li></ul>
    </div>
    <br><br>
	<form action="/sys/ad/save.html" method="post">
		<input name="id" type="hidden" value="${(ad.id)!""}">
	    <ul class="forminfo">
		    <li>
		    	<label>广告类型：</label>
        		<select class="select3" name="category" style="width: 100px;">
				    <option value="">选择广告类型</option>
				    <#if adCats??><#list adCats as item>
				    <option value=${item.val} <#if (ad.category)?? && (ad.category)?number ==item.val>selected="selected"</#if>>${(item.text)!""}</option>
			        </#list></#if>
			    </select>
		    	<i><font class="font-red">*</font></i>
		    </li>
		    <li>
		    	<label>广告标题：</label>
		    	<input name="title" type="text" class="scinput input-lg" value="${(ad.title)!""}" <#if op?? && op="view">disabled=true</#if> autocomplete="off" />
		    	<i><font class="font-red">*</font></i>
		    </li>
		    <li>
		    	<label>链接地址：</label>
		    	<input name="url" type="text" class="scinput input-lg" value="${(ad.url)!""}" <#if op?? && op="view">disabled=true</#if> autocomplete="off" />
		    	<i><font class="font-red">*</font></i>
		    </li>
		    <li>
		    	<label> 显示顺序：</label>
		    	<input name="displayOrder" type="text" class="scinput input-lg" value="${(ad.displayOrder)!""}" <#if op?? && op="view">disabled=true</#if> autocomplete="off" />
		    	<i><font class="font-red">*</font></i>
		    </li>
		    <li>
		    	<label>广告状态：</label>
            	<select class="select3" name="status" style="width: 100px;" <#if op?? && op="view">disabled=true</#if>>
				    <option value="">选择状态</option>
				    <option value=1 <#if (ad.status)?? && (ad.status)?number ==1>selected="selected"</#if>>开启</option>
				    <option value=2 <#if (ad.status)?? && (ad.status)?number ==2>selected="selected"</#if>>关闭</option>
			    </select>
		    	<i><font class="font-red">*</font></i>
		    </li>
		    <li>
		    	<label>图片地址：</label>
		    	<div class="img_show_outer img_show_wapper img_upload" id="uploadBtnOuter">
		    		<img src="/images/loading_1.gif" id="loadingImg" style="display: none; width: 32px; min-height: 32px; margin-top: 20px;">
		    		<span class="img_show_cover" id="uploadingBtn" style="display: none;">正在上传...</span>
		    		<img src="${(ad.imageUrl)!"/images/icon_add.png"}" id="addImg">
		    		<span class="img_show_cover" id="uploadBtn">上传</span>
		    	</div>
		    	<input name="file" id="file" type="file" class="scinput input-lg" style="display:none;"/>
		    	<input name="imageUrl" type="hidden" value="${(ad.imageUrl)!""}"/>
		    </li>
		    <li>
		    	<label>备注：</label>
		    	<input name="description" type="text" class="scinput input-lg" value="${(ad.description)!""}" <#if op?? && op="view">disabled=true</#if> autocomplete="off" />
		    	<i><font class="font-red">*</font></i>
		    </li>
		    <li>
		    	<label>&nbsp;</label>
		    	<#if !op?? || op!="view">
		    	<input id="submitBtn" type="button" class="btn" value="提交"/>&emsp;
		    	</#if>
		    	<input id="cancelBtn" type="button" class="btn" value="返回"/>
		    </li>
	    </ul>
	</form>
</body>
<script type="text/javascript" src="/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="/js/commonAdd.js"></script>
<script>
//  imgDir	上传文件目录编号，各自上传页面设定：1、广告；2、产品；3、帮助；4、分类推荐；9、其他
var imgDir = 1;
/**
 * 处理上传完成后的事情，上传方法在commonAdd.js
 * @param imgUrl
 */
function handleAfterUpload(imgUrl) {
	$("input[name='imageUrl']").val(imgUrl);
	$("#addImg").attr("src", imgUrl);
}
</script>
</html>